﻿#ifndef LAMPTOOLBAR_H
#define LAMPTOOLBAR_H

#include <QLabel>
#include <QToolBar>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QSlider>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QVBoxLayout>
class LampControl;
class LampToolBar : public QToolBar
{
    Q_OBJECT
public:
    LampToolBar(QWidget *parent = nullptr);
    void attach(LampControl *top, LampControl * bottom);
private:
    void initContent();
    void initConnection();
private slots:
    void updateTopLampIntensity(int value);
    void updateBottomLampIntensity(int value);
    void setTopLampIntensity(int value);
    void setBottomLampIntensity(int value);
    void setOrientation(Qt::Orientation orientation);
private:
    QGroupBox *groupBox;
//    QVBoxLayout *verticalLayout;
    QSlider *sliderTop;
    QLabel *labelTopName;
    QLabel *labelTopValue;
    QSlider *sliderBottom;
    QLabel *labelBottomName;
    QLabel *labelBottomValue;
private:
    LampControl * m_pTopLamp = nullptr;
    LampControl * m_pBottomLamp = nullptr;
};

#endif // LAMPTOOLBAR_H
